package com.xuesheng.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xuesheng.entity.Junxun;
import com.xuesheng.entity.Rxdj;
import com.xuesheng.entity.vo.JunxunVo;
import com.xuesheng.entity.vo.RxdjVo;
import com.xuesheng.mapper.RxdjMapper;
import com.xuesheng.qpage.QPage;
import com.xuesheng.service.IRxdjService;
import com.xuesheng.util.Result;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 入学登记 服务实现类
 * </p>
 *
 * @author author
 * @since 2024-04-19
 */
@Service
public class RxdjServiceImpl extends ServiceImpl<RxdjMapper, Rxdj> implements IRxdjService {

    /**
     * 分页查询分类
     * @param qPage
     * @return
     */
    @Override
    public IPage getPageList(QPage qPage, RxdjVo obj) {
        IPage iPage = new Page(qPage.getPage(), qPage.getRows());
        List<RxdjVo> mapList = this.baseMapper.getPageList(iPage,obj);
        return iPage.setRecords(mapList);
    }

    /**
     * 新增
     * @param obj
     * @return
     */
    @Override
    public Result insert(Rxdj obj) {
        this.save(obj);
        return Result.reOk("恭喜，新增成功");
    }

    /**
     * 修改
     * @param obj
     * @return
     */
    @Override
    public Result updates(Rxdj obj) {
        this.updateById(obj);
        return Result.reOk("恭喜，修改成功");
    }


}
